<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">

<head>
  <th:block data-th-replace="/adminlte/base::base-head"></th:block>
</head>

<body class="hold-transition sidebar-mini layout-fixed">
  <div class="wrapper">
    <th:block data-th-replace="/adminlte/base::base-navbar"></th:block>
    <th:block data-th-replace="/adminlte/base::base-main-sidebar"></th:block>
    <div class="content-wrapper">
      <th:block data-th-replace="/adminlte/base::base-content-header"></th:block>
      <section class="content">
        <div class="container-fluid">
          <div class="row">
            <div class="col-sm-12">
              <div class="card">
                <div class="card-header">
                  <div class="card-title">RSA设置</div>
                </div>
                <form class="form-horizontal" action="/encryptions/rsa" method="put">
                  <div class="card-body">
                    <div class="form-group">
                      <label class="col-sm-2 control-label">RSA私钥（2048）</label>
                      <div class="col-sm-12">
                        <textarea class="form-control" placeholder="RSA私钥（2048）" th:text="${encryption.rsaKey.privateKey}"
                          rows="10" maxlength="2048" disabled="disabled"></textarea>
                      </div>
                    </div>
                    <div class="form-group">
                      <label class="col-sm-2 control-label">RSA公钥（2048）</label>
                      <div class="col-sm-12">
                        <textarea class="form-control" placeholder="RSA公钥（2048）" th:text="${encryption.rsaKey.publicKey}"
                          rows="3" maxlength="2048" disabled="disabled"></textarea>
                      </div>
                    </div>
                    <hr>
                    <div class="row justify-content-center">
                      <button type="button" class="btn btn-warning" style="width: 200px;"
                        data-url="/encryptions/rsa"
                        onclick="postThis(this, (status, data, headers)=>toast.success(getMessage(headers), reload), (status, data, headers)=>toast.failure(getMessage(headers)))">生成密钥</button>
                    </div>
                  </div>
                </form>
              </div>

              <div class="card">
                <div class="card-header">
                  <div class="card-title">AES设置</div>
                </div>
                <form class="form-horizontal" action="/encryptions/aes" method="put">
                  <div class="card-body">
                    <div class="form-group">
                      <label class="col-sm-2 control-label">AES密钥（16位）</label>
                      <div class="col-sm-12">
                        <input type="text" class="form-control" disabled="disabled" placeholder="网站密钥（16位）"
                          th:value="${encryption.aesKey.key}" autofocus="autofocus" maxlength="16">
                      </div>
                    </div>
                    <div class="form-group">
                      <label class="col-sm-2 control-label">AES偏移（16位）</label>
                      <div class="col-sm-12">
                        <input type="text" class="form-control" disabled="disabled" placeholder="密钥偏移（16位）"
                          th:value="${encryption.aesKey.iv}" maxlength="16">
                      </div>
                    </div>
                    <hr>
                    <div class="row justify-content-center">
                      <button type="button" class="btn btn-warning" style="width: 200px;"
                        data-url="/encryptions/aes"
                        onclick="postThis(this, (status, data, headers)=>toast.success(getMessage(headers), reload), (status, data, headers)=>toast.failure(getMessage(headers)))">生成密钥</button>
                    </div>
                  </div>
                </form>
              </div>

            </div>
          </div>
        </div>
      </section>
    </div>
    <th:block data-th-replace="/adminlte/base::base-footer"></th:block>
    <th:block data-th-replace="/adminlte/base::base-control-sidebar"></th:block>
  </div>
</body>

</html>